导航菜单
首页 >  database  > Relational Database: Definition, Examples, and More

Relational Database: Definition, Examples, and More

Relational databases are tools for storing various types of information that are related to each other in some way.

Data engineers build and design relational databases (and other data management systems) to assist organizations in collecting, storing, and analyzing data. Then, data analysts and data scientists use them for digesting large amounts of data and identifying meaningful insights.

Learn more about relational database features, use cases, and how to work with them in the following article.

What is a relational database?

A relational database is a type of database that stores and allows access to data. These types of databases are referred to as "relational" because the data items within them have pre-determined relationships with one another.

Data in a relational database is stored in tables. The tables are connected by unique IDs or "keys." When a user needs to access specific information, they can use a key to access all the tables of data that have been pre-determined to be related to that key.

Relational database use case (example)

Suppose you're working for a company that sells clothes online. Your organization uses a relational database to manage data related to shipping, customer information, inventory, and website traffic. You have a key to this database that accesses all tables related to shipping, and you need to find out if you have enough inventory to ship out last week's orders.

Since the relational database recognizes that there's a relationship between shipping information and inventory, you can use your key to access inventory numbers and shipping requests to compare data. During this request, you won't access any information about website traffic because your key only accesses the tables of data that are related to shipping.

Watch this video to get an introduction to relational databases and preview IBM's Data Engineering Professional Certificate:

How do relational databases work?

Relational databases are built on relatively simple concepts that can become increasingly complex as the data contained within them grows. Let's dive into it.

Relational Database Management Systems (RDBMS)

An RDBMS is a program that enables you to create, update, and perform administrative tasks with a relational database. The difference between a relational database and an RDBMS is that relational databases organize information based on a relational data model. In contrast, RDBMS is database software that allows users to maintain the database. 

Example: Common examples of relational database management systems include MySQL, Microsoft SQL Server, and Oracle Database.

PlaceholderProcessing requests and retrieving information

In an RDBMS, users input SQL queries to retrieve the data needed for specific job functions. SQL stands for Structured Query Language. It's a standardized way to request information from relational databases.

Example: It's similar to the way you might type your question into Google much differently than you'd ask a friend for the same information. Instead of saying, "what's that funny rap song from the Sonic the Hedgehog 2 movie?" you might type in "Sonic the Hedgehog 2 soundtrack list." This formatting change makes it easier for the algorithm to pull the data you need immediately.

Organizing related data points

As mentioned above, the data in a relational database is stored in tables. Each row in a table has an access key, and each column has data attributes. The attributes have values that help users understand the relationships between data entries.

Example: A relational database for a shoe store has two tables with related data. In the first single table, each record includes columns containing the customer’s billing and shipping information. Each row is assigned a key. The second single table contains the customer's order information (product, size, quantity). The keys from the first table are listed alongside the order information in the second table because the database recognizes their relationship to one another. This setup makes it easy for the warehouse to pull the correct product from the shelf and ship it to the right customer. 

You can get hands-on practice working with relational databases and SQL with this Guided Project: Introduction to Relational Database and SQL. In just one hour, you'll have created your own billing report and club member roster.

Relational vs. non-relational database

Non-relational databases do not store data in rows and columns like their relational counterparts. Instead, non-relational databases store information in a way that is optimized for the specific data being stored. For example, non-relational databases may store information in key-value pairs or graphs. Non-relational databases are called NoSQL databases because they do not use Structured Query Language for requests.

Read more: Relational vs. Non-relational Database: The Difference Explained

PlaceholderRelational database features

These database types are used for processing and managing transactions. They are often used in retail, banking, and entertainment industries, where an exact amount (of money, tickets, or products) is withdrawn from one location or account and deposited into another. Transactions like these have properties that can be represented by the acronym ACID, which stands for:

Atomicity: All parts of a transaction are executed completely and successfully, or else the entire transaction fails. 

Consistency: Data remains consistent throughout the relational database. Data integrity, or the accuracy and completeness of the data at hand, is enforced in relational databases with integrity constraints (similar to rule enforcers).

Isolation: Each transaction is independent of other transactions. Data from one record does not spill onto another, so it is secure.

Durability: Even if the system fails, data from completed transactions are safely stored.

By taking the relational approach to data queries, data and business analysts can perform specific functions to obtain the information they need to organize query results by name, date, size, and location. This relational model also means that the logical data structures, such as tables and indexes, are completely separate from physical storage.

Read more: Relational vs. Non-relational Database: The Difference Explained

Why is a relational database important?

A relational database’s main benefit is the ability to connect data from different tables to obtain useful insight. This approach helps organizations of all sizes and industries decipher the relationships between different data sets from various departments.

How data is structured within a relational database can also be useful for managing access permissions. Since the relationships between data points are pre-determined and require a unique ID to reference, users only obtain relevant, pre-screened information.

Benefits of relational databases

Here are a few more advantages of relational databases:

Simple and centralized database: Relational databases are simple. Toggling between tables provides a wealth of information that can be used for various purposes. Plus, ERP systems are built on relational databases, so they help users manage clients, inventory, and much more.

Easy to use: Many companies use relational databases, and ERP, to organize and manage large amounts of data. Their continued use helps to drive improvements to these systems—such as migrating to the cloud. Using SQL, users can easily navigate data sets to retrieve, filter, and ideate the information they need. 

Save time and money: By using relational databases, companies can stay organized and efficient. The unique IDs help eliminate duplicate information, whether it is tracking a customer’s order or museum visitors. Instead of taking time to input logs of customer data, a relational database reduces redundancy, thus saving employees time. Companies can save money by allocating that labor elsewhere.

Careers that use relational databases

Data engineer:  Data engineers design and build systems for collecting and analyzing data. They typically use SQL to query relational databases to manage the data, as well as look out for inconsistencies or patterns that may positively or negatively affect an organization’s goals. 

Database administrator: Database administrators act as technical support for databases, ensuring optimal performance by performing backups, data migrations, and load balancing.

Data architect: Data architects analyze the data infrastructure of an organization to plan or implement databases and database management systems that improve efficiency in workflows.

Data analyst: Data analysts take data sets from relational databases to clean and interpret them to solve a business question or problem. They can work in industries as varied as business, finance, science, and government.

Data scientist: Data scientists take those data sets to find patterns and trends, and then will create algorithms and data models to forecast outcomes. They might use machine learning techniques to improve the quality of data or product offerings.

Read more: 4 Data Analyst Career Paths: Your Guide to Leveling Up

Start advancing your skills in relational databases today

Prepare for a career in data science or learn how to work with relational databases in your organization with IBM's Introduction to Relational Databases (RDBMS). In just 19 hours, you'll strengthen your data science skills with hands-on relational database exercises and earn a certificate to enhance your resume.

相关推荐: